package cn.edu.zafu.bigdata.x.huangxihao202211080211;

class MathOperations{
    public int add(int a,int b){
        return a+b;
    }

    public double add(double a,double b){
        return a+b;
    }

    public int add(int a,int b,int c){
        return a+b+c;
    }
}

public class MethodOverload {
    public static void main(String[] args){
        MathOperations mathops=new MathOperations();
        int sum1=mathops.add(1,2);
        System.out.println(sum1);
        double sum2=mathops.add(1.2,2.3);
        System.out.println(sum2);
        int sum3=mathops.add(1,2,3);
        System.out.println(sum3);
    }
}
